import axios from '@/utils/axios'

export const getInfo = () => {
    return axios.get("/users/info")
}

export const userAddreq = (data) => {
    return axios.post('/users/add', data)
}

export const userListReq = (data) => {
    return axios.get("/users/list", {
        params: data
    })
}

export const userDelReq = (data) => {
    // debugger
    return axios.get('/users/del', {
        params: {
            id: data
        }
    })
}


export const delBatchdel = (data) => {
    // debugger
    return axios.get('/users/batchdel', {
        params: {
            ids: data
        }
    })
}   

export const checkoldpwdReq = (data) => {
    return axios.get('/users/checkoldpwd',{
        params:{
            oldPwd:data
        }
    })
}

//修改账号
export const userEdit = (data) => {
    return axios.post('/users/edit',data)
}


//  /users/avataredit
export const avatarEditReq = (imgUrl) => {
    return axios.get('/users/avataredit',{
        params:{
            imgUrl
        }
    })
}


// /users/editpwd
export const editPwdReq = (data) => {
    return axios.post('/users/editpwd', {newPwd:data})
}